#!/bin/bash
password="gdbyway@123"
current_date=$(date +%Y-%m-%d)
current_time=$(date +%H:%M:%S)

cmd="df -Th |grep /dev/mapper/storage-data"
while IFS= read -r ip
do
ip_array+=("$ip")
done < servers.txt
echo "swarmpit磁盘情况-$current_date $current_time"
echo -e "\n"
df -Th | grep "^文件系统"
for ip in "${ip_array[@]}"
do
  echo "$ip "
   sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$ip" "$cmd"
 # echo -e "\n"
done
